//
// Created by wujehy on 2020/8/23.
//

#ifndef MQTTCLIENT_COMMON_H
#define MQTTCLIENT_COMMON_H

#include <string>
#ifdef __cplusplus
extern "C"{
#endif __cplusplus
namespace GeeJoan
{
    namespace Common
    {
        std::string get_uuid();

        int64_t getTimeMicro();

        int64_t getTimeMilli();

        std::string Base64Encode(const unsigned char *Data, int DataByte);

        std::string Base64Decode(const char *Data, int DataByte, int &OutByte);

        bool GetMd5(std::string &str_md5, const char *const buffer, size_t buffer_size);

        bool GetPathFileNameAndFilePath(const std::string &allPath, std::string &filePath, std::string &filename, bool isUnix = true);

        std::string StringToHex(const std::string &data);

        std::string HexToString(const std::string &data);
    };

}

#ifdef __cplusplus
}
#endif __cplusplus
#endif //MQTTCLIENT_COMMON_H
